<?php
/**
 * Created by PhpStorm.
 * User: zhan
 * Date: 2019/1/2  16:34
 */
namespace app\driver\controller;

class Order extends Base
{
    //检查权限作用域
    protected $beforeActionList  = [
        'checkPrimaryScope' => [
            'except' => 'except'
        ],
    ];

    //订单列表
    public function orderList()
    {
        $orderList = (new \app\driver\logic\Order())->orderList();
        return $this->ajaxReturn($orderList);
    }

//    订单详情
    public function orderInfo()
    {
        $orderInfo = (new \app\driver\logic\Order())->orderInfo();
        return $this->ajaxReturn($orderInfo);
    }

    //开始配送
    public function startSend()
    {
        $startSend = (new \app\driver\logic\Order())->startSend();
        return $this->ajaxReturn($startSend);
    }

    //确认送达
    public function updateSendstatus()
    {
        $orderInfo = (new \app\driver\logic\Order())->updateSendstatus();
        return $this->ajaxReturn($orderInfo);
    }

    //我的评分
    public function comments()
    {
        $comments = (new \app\driver\logic\Order())->comments();
        return $this->ajaxReturn($comments);
    }

    public function commentInfo()
    {
        $commentInfo = (new \app\driver\logic\Order())->commentInfo();
        return $this->ajaxReturn($commentInfo);
    }

    //评论回复
    public function reply()
    {
        $reply = (new \app\driver\logic\Order())->reply();
        return $this->ajaxReturn($reply);
    }

    //订单通知
    public function orderTips()
    {
        $orderTips = (new \app\driver\logic\Order())->orderTips();
        return $this->ajaxReturn($orderTips);
    }

    //订单通知详情
    public function orderTipinfo()
    {
        $orderTips = (new \app\driver\logic\Order())->orderTipinfo();
        return $this->ajaxReturn($orderTips);
    }

    //接单
    public function orderTake()
    {
        $orderTake = (new \app\driver\logic\Order())->orderTake();
        return $this->ajaxReturn($orderTake);
    }

    //不接单
    public function orderunTake()
    {
        $orderunTake = (new \app\driver\logic\Order())->orderunTake();
        return $this->ajaxReturn($orderunTake);
    }

    public function is_empty_unfinish_order(){
        $orderunTake = (new \app\driver\logic\Order())->is_empty_unfinish_order();
        return $this->ajaxReturn($orderunTake);
    }

}